{include file="../public/head" /}

<link rel="stylesheet" href="__STATIC__/mobile/css/mdui.css" />
<link rel="stylesheet" href="__STATIC__/mobile/css/app.css" />

</head>
<body>
<div class="container-fluid">
    <!--右部菜单-->
    {include file="public/right" /}
    <div class="log-logo">
        <h1 class="title-center" style="text-align: center;">个人信息</h1>
    </div>
    <div class="log">
        <div class="log-con">
            <!--form元素开始-->
            <div class="m-t ibox-content layui-form">
                <div class="layui-form-item">
                    <label class="layui-form-label">真实姓名</label>
                    <div class="layui-input-block">
                        {$user_msg.username}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">住户</label>
                    <div class="layui-input-block">
                        {$user_msg.home}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">手机号码</label>
                    <div class="layui-input-block">
                        {$user_msg.tel}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        {$user_msg.status|status}
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="notice" placeholder="业主注释（不公开）" class="layui-textarea" maxlength="200" value="{$user_msg.notice}">{$user_msg.notice}</textarea>
                    </div>
                </div>
                <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="component-form-element">修改</button>
            </div>
            <!--form元素结束-->
        </div>
    </div>
    <script>
        //Demo
        layui.use('form', function(){
            var form = layui.form;
            //监听提交
            form.on('submit(component-form-element)', function (data) {
                var index = layer.load();
                //$('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
                $.ajax({
                    url:"{:url('index/user/index')}",
                    type:'post',
                    dataType:'json',
                    data:data.field,
                    success:function(res){
                        if (res.data == 1) {
                            layer.close(index);
                            layer.msg(res.message);
                            setTimeout('window.location.reload()',2000);
                        } else if (res.datas == 0) {
                            layer.close(index);
                            layer.open({
                                title: '修改失败'
                                ,content: res.message
                            });
                        } else {
                            layer.close(index);
                            layer.open({
                                title: '修改失败'
                                ,content: '出现未知错误，如果问题一直出现，您可以联系管理员或站点留言'
                            });
                        }
                    },error:function () {
                        layer.close(index);
                        layer.open({
                            title: '修改失败'
                            ,content: '当前网络环境不安全，拒绝登录，请调整网络环境'
                        });
                    }
                })
            });
        });
    </script>
    <!--底部版权-->
    {include file="../public/footer" /}
</div>
<script src="__STATIC__/mobile/js/mdui.js"></script>
</body>
</html>